<template>
  <!-- 标题 -->
  <div class="flex">
    <div class="blue-radius"></div>
    <h2 class="page-title">医生管理</h2>
  </div>

  <el-form :inline="true" :model="formItem" class="demo-form-inline">
    <el-form-item label="所属团队" style="margin-right: 20px;">
      <el-select v-model="formItem.teamIds" placeholder="请选择" clearable style="width: 200px;">
        <el-option :label="item.name" :value="item._id" v-for="item in teamData.rows" :key="item._id" />
      </el-select>
    </el-form-item>
    <el-form-item label="所属机构" style="margin-right: 20px;">
      <el-select v-model="formItem.organizationId" placeholder="请选择" clearable style="width: 200px;">
        <el-option :label="item.name" :value="item._id" v-for="item in organizationsData.rows" :key="item._id" />
      </el-select>
    </el-form-item>
    <el-form-item label="医生标签" style="margin-right: 60px;">
      <el-select v-model="formItem.region" placeholder="请选择" clearable style="width: 200px;">
        <el-option label="Zone one" value="shanghai" />
        <el-option label="Zone two" value="beijing" />
      </el-select>
    </el-form-item>
    <el-form-item style="margin-right: 0;">
      <el-button type="primary" @click="toAdd">新增医生信息</el-button>
      <el-button>导出</el-button>
    </el-form-item>
    <el-form-item style="margin-top: 16px;">
      <el-input v-model="formItem.region" style="width: 346px;height: 40px;" size="large" placeholder="请输入关键字"
        :suffix-icon="Search" />
    </el-form-item>
  </el-form>
</template>

<script setup>
import { onMounted, ref } from 'vue';
import { Search } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
import { useFindData } from '../../composables/findData';
const { organizationsData, findOrganizationsDataAsync, teamData, getTeamDataAsync } = useFindData()
const router = useRouter()
// 搜索的表单数据
const formItem = ref({
  organizationId: '',
  region: '',
  teamIds: []
})
const toAdd = () => {
  router.push('/data/doctor/add')
}
onMounted(() => {
  findOrganizationsDataAsync()
  getTeamDataAsync()
})
</script>
<style soped>
.top-outer-layer {
  display: flex;
  height: 45px;
  /* border-bottom: 1px solid #dcdbdb; */
  margin-bottom: 20px;
}

.border-left {
  width: 6px;
  height: 24px;
  background-color: rgba(41, 132, 248, 1);
  border-radius: 10px;
}

.add-text {
  margin-left: 10px;
  font-size: 18px;
  color: rgba(51, 51, 51, 0.898039215686275);
}

/* 修改 placeholder 颜色 */
::v-deep .el-input__inner::placeholder {
  color: #ccc;
  /* 浅灰色，可按需调整 */
}
</style>
<style>
.el-button--primary {
  --el-button-bg-color: var(--el-color-primary);
}

.page-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 550;
  color: #333333E5;
}

.blue-radius {
  border-width: 0px;
  width: 6px;
  height: 20px;
  background: inherit;
  background-color: rgba(41, 132, 248, 1);
  border: none;
  border-radius: 8px;
  -moz-box-shadow: none;
  -webkit-box-shadow: none;
  box-shadow: none;
  margin-top: 4px;
  margin-right: 10px;
}
</style>